<?php
require 'include/global.php';
require_once 'include/train_db.php';
$smarty->compile_check = true;




$sql    = "  SELECT * FROM `pa_advisory` WHERE `ad_id`= '".$_GET[id]."'  ";
$result = $DB->query($sql);

$list = $DB->fetch_one_array($sql);
$list[ad_upload]  = (file_exists("./uploadfiles/advisory/".$list[ad_upload])&&$list[ad_upload]!='')?$list[ad_upload]:"noimages.jpg";

$list[ad_state]       = ($list[ad_state]!=0)?$state[$list[ad_state]]:"N/A";
$list[ad_country]     = ($list[ad_country]!=0)?$country[$list[ad_country]]:"N/A";
$list[ad_industry]    = ($list[ad_industry]!=0)?$jobcategory[$list[ad_industry]]:"N/A";
$list[ad_generalarea] = ($list[ad_generalarea]!=0)?$service[$list[ad_generalarea]]:"N/A";
$a = ($list[ad_primarystate]!=0)?$state[$list[ad_primarystate]]:"N/A";
$b = ($list[ad_primarycountry]!=0)?$country[$list[ad_primarycountry]]:"N/A";
$list[ad_primaryarea] = $a.",".$b;
$list[ad_specialty]   = ($list[ad_specialty]==0)?$list[ad_specialty]:"N/A";

$list[ad_website]     = changeURL($list[ad_website]);

$list[ad_links_1]     = cutURL($list[ad_links_1]);
$list[ad_links_2]     = cutURL($list[ad_links_2]);
$list[ad_links_3]     = cutURL($list[ad_links_3]);

$list[ad_sites_1]     = cutURL($list[ad_sites_1]);
$list[ad_sites_2]     = cutURL($list[ad_sites_2]);
$list[ad_sites_3]     = cutURL($list[ad_sites_3]);

if($_GET[id]==''||empty($list)){
   echo "<meta http-equiv=\"refresh\" content=\"0;URL=errorall.php?errid=ad_1004\">";
   exit;
}
$smarty->assign('list',$list);
$smarty->display('header.tpl');
$smarty->display('advisordetail.tpl');
$smarty->display('advisorright.tpl');
$smarty->display('footer.tpl');


?>
